import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author JiuQi 玖柒
 * @date 2021/7/6 22:11
 */
public class T977 {
    public static void main(String[] args) {
        int[] nums = {-7, -3, 2, 3, 11};
        System.out.println(Arrays.toString(new Solution6().sortedSquares(nums)));
    }
}

class Solution6 {
    public int[] sortedSquares(int[] nums) {
        int[] temp = new int[nums.length];
        for (int i = 0; i < nums.length; i++) {
            temp[i] = nums[i] * nums[i];
        }
        Arrays.sort(temp);
        return temp;
    }
}
